package com.creative.accountsdk.net.account;

import com.creative.accountsdk.net.Protocol;
import com.creative.accountsdk.net.XParams;
import com.creative.util.EncodeUtil;
import com.loopj.android.http.RequestParams;

import org.json.JSONObject;

/**
 * Created by yinjialiang on 15-2-14.
 */
public class ModifyPasswordProtocol extends Protocol {
    private String oldPassword, newPassword;

    public ModifyPasswordProtocol(String oldPassword, String newPassword)
    {
        this.oldPassword = oldPassword;
        this.newPassword = newPassword;
    }

    @Override
    public RequestParams getParams() {
        return new XParams()
                .put("opwd", EncodeUtil.encryptByBase64(oldPassword))
                .put("npwd", EncodeUtil.encryptByBase64(newPassword))
                .put("repwd", EncodeUtil.encryptByBase64(newPassword))
                .getParams();
    }

    @Override
    public String getUrl() {
        return Protocol.getUrlPrefix()+"chgpwd";
    }

    @Override
    protected void parseReturnMap(JSONObject returnMap) {

    }
}
